package ATMDispenser;

import java.util.Scanner;

public class ATMRunner {

	public static void main(String[] args) {
		ATMNotesDispenser atm = new ATMNotesDispenser();
		
		int amount = 0;
		
		while (amount != 9999) {
			System.out.println("\nEnter amount to dispense (9999 to shut)");
			@SuppressWarnings("resource")
			Scanner input = new Scanner(System.in);
			amount = input.nextInt();
			if (amount != 9999){
				
				if (amount % 5 != 0) {
					System.out.println("Amount should be in multiple of 5's.");
					break;
				}
			// process the request
			atm.dispense(amount);
			}
			else
				System.out.println("System has shut down");
		}
	}
}
